﻿using System;
using System.Architecture;
using System.Collections;
using System.Collections.Data;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Composition;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Input;
using HDK.API.Syndication;
using HDK.UI.Controls;
using Microsoft.Practices.Prism.Regions;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Navigation;

// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238

namespace HDK.Demo.Pages
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    [Shared]
    [ExportView("Pages/HDKHUB", "HDK.HUB", new string[] { "MainRegion" })]
    public sealed partial class HDKHUB : HDK.UI.Controls.LayoutAwarePage, IPageView
    {
        public HDKHUB()
        {
            this.InitializeComponent();

        }

        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.  The Parameter
        /// property is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            //(semanticZoom.ZoomedOutView as ListViewBase).ItemsSource = itemsViewSource.View.CollectionGroups;
        }

        private void Grid_DoubleTapped_1(object sender, DoubleTappedRoutedEventArgs e)
        {
            var rn = RegionManager.GetRegionName(this.Parent);
            var rm = RegionManager.GetRegionManager(this.Parent);
            rm.RequestNavigate(rn, "//Pages/GroupDetails");
        }



        public string Title
        {
            get { return "HDK HUB"; }
        }

        private void btnSwitchView_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
        {
            //AdvancedSemanticZoom s = asz;
            //semanticZoom.ToggleActiveView();
        }
    }

    [Shared]
    [ExportViewModel("HDK.HUB")]
    public class HDKHUBViewModel : NavigationAwareViewModel
    {
        public IEnumerable FiltererSource
        {
            get
            {
                return null;
            }
        }

        private HubItemFilter _libraryFilter;
        public HubItemFilter LibraryFilter
        {
            get { return _libraryFilter; }
            set {
                SetProperty<HubItemFilter>(ref _libraryFilter, value);
            }
        }

        public DelegateCommand<HubItemFilter> ApplyFilterCommand
        {
            get
            {
                return new DelegateCommand<HubItemFilter>((lastSelectedFilter) =>
                {
                   PushOrPopToFilter(lastSelectedFilter);
                   UpdateResults();
                   UpdateBookFilters();

                });
            }
        }

        public HDKHUBViewModel()
        {
            FilterStack = new ObservableCollection<HubItemFilter>();

            LibraryFilter = new HubItemsCollectionFilter(this.HubItems);
            LibraryFilter.IsFirstInStack = true;

            //this.PushFilter(_libraryFilter);
        }
        #region FilterStack

        public void PushFilter(HubItemFilter filter)
        {
            HubItemFilter last = this.PeekFilter();
            if (last != null)
            {
                last.IsLastInStack = false;
            }

            FilterStack.Add(filter);

            filter.IsLastInStack = true;
            NotifyPropertyChanged("FilterStack");

            UpdateResults();
            UpdateBookFilters();
        }

        public HubItemFilter PeekFilter()
        {
            if (FilterStack.Count > 0) return FilterStack.Last();
            return null;
        }

        public HubItemFilter PopFilter()
        {
            HubItemFilter filter = FilterStack.Last();

            if (FilterStack.Count > 1)
            {
                FilterStack.RemoveAt(FilterStack.Count - 1);
                NotifyPropertyChanged("FilterStack");
                UpdateResults();
                UpdateBookFilters();
            }

            return filter;
        }

        /// <summary>
        /// Pops filters off the stack until the provided filter is on top of the stack 
        /// or the stack is empty (and just the default filter remains)
        /// </summary>
        public HubItemFilter PopToFilter(HubItemFilter filter)
        {
            while (FilterStack.Count > 0)
            {
                if (FilterStack.Last() == filter)
                {
                    return filter;
                }
                else
                {
                    PopFilter();
                }
            }

            if (FilterStack.Count > 0)
            {
                return FilterStack.Last();
            }
            return null;
        }

        /// <summary>
        /// If the provided filter is already in the stack, then we pop to it. Else, if it is a valid
        /// subfilter of the top of the stack then we push it. Otherwise, we do nothing.
        /// </summary>
        public void PushOrPopToFilter(HubItemFilter filter)
        {
            // check to see if its already in our history
            if (FilterStack.Contains(filter))
            {
                PopToFilter(filter);
                return;
            }

            FilteredHubItemFilter last = this.PeekFilter() as FilteredHubItemFilter;
            if (last != null && last.SubFilters.Contains(filter))
            {
                PushFilter(filter);
            }
        }

        public ObservableCollection<HubItemFilter> FilterStack { get; private set; }

        #endregion
        private void UpdateBookFilters()
        {
            HubItemFilter last = this.PeekFilter();
            if (last == null) return;
            last.RefreshResults();
            if (last.Results == null) return;

            //List<BookViewModel> filteredBooks = last.Results;

            //bool hasChanges = false;

            //foreach (BookViewModel book in this.Books)
            //{
            //    hasChanges = hasChanges || ((filteredBooks.Contains(book) && !book.IsFiltered) || (!filteredBooks.Contains(book) && book.IsFiltered));
            //}

            //if (hasChanges)
            //{
            //    RaiseFilteredBooksChanging();

            //    foreach (BookViewModel book in this.Books)
            //    {
            //        if (filteredBooks.Contains(book))
            //        {
            //            book.IsFiltered = true;
            //        }
            //        else
            //        {
            //            book.IsFiltered = false;
            //        }
            //    }

            //    RaiseFilteredBooksChanged();
            //}
        }
        #region Results
        /// <summary>
        /// A collection that we can bind to that represents the results that should
        /// be displayed in the LibraryNavigation area.
        /// </summary>
        public IEnumerable<object> DisplayResults { get; private set; }

        private void UpdateResults()
        {
            HubItemFilter topFilter = this.PeekFilter();
            if (topFilter != null)
            {
                if (topFilter is FilteredHubItemFilter && topFilter.HasSubFilters)
                {
                    // return a collection of subfilters
                    (topFilter as FilteredHubItemFilter).RefreshSubFilters();
                    DisplayResults = (topFilter as FilteredHubItemFilter).SubFilters.AsEnumerable();
                    NotifyPropertyChanged("DisplayResults");
                }
                else
                {
                    // return the book results
                    topFilter.RefreshResults();
                    DisplayResults = null;
                    NotifyPropertyChanged("DisplayResults");

                    
                    //DisplayResults = topFilter.Results;
                    //NotifyPropertyChanged("DisplayResults");
                }
            }
        }

        #endregion

        private HubItem m_selectedItem;
        public HubItem SelectedItem
        {
            get { return m_selectedItem; }
            set {
                m_selectedItem = value; 
                this.NotifyPropertyChanged<HubItem>(() => SelectedItem); 
            }
        }

        public IEnumerable<object> HubItemsByCategory
        {
            get
            {
                var q = from item in HubItems
                        orderby item.Category
                        group item by item.Category into g
                        select g;
                return q;
            }
        }

        public List<HubItem> HubItems
        {
            get
            {
                List<HubItem> results = new List<HubItem>();
                results.Add(new HubItem() {
                    Name = "Sample Item 0", Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 2,
                    Width = 6,
                    Direction = AnimationDirection.Top,
                    ImagePath = @"/Assets/TileImages/1.png"
                });
                results.Add(new HubItem() {
                    Name = "Sample Item 1", Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 1,
                    Width = 3,
                    Direction = AnimationDirection.Right,
                    ImagePath = @"/Assets/TileImages/2.png"
                });
                results.Add(new HubItem() {
                    Name = "Sample Item 2", Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 1,
                    Width = 3,
                    Direction = AnimationDirection.Top,
                    ImagePath = @"/Assets/TileImages/3.png"
                });
                results.Add(new HubItem() { 
                    Name = "Sample Item 3", Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 1,
                    Width = 3,
                    Direction = AnimationDirection.Top,
                    ImagePath = @"/Assets/TileImages/4.png"
                });
                results.Add(new HubItem() {
                    Name = "Sample Item 4", Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 2,
                    Width = 3,
                    Direction = AnimationDirection.Right,
                    ImagePath = @"/Assets/TileImages/5.png"
                });
                results.Add(new HubItem() {
                    Name = "Sample Item 5", Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 1,
                    Width = 2,
                    Direction = AnimationDirection.Top,
                    ImagePath = @"/Assets/TileImages/6.png"
                });
                results.Add(new HubItem() {
                    Name = "Sample Item 6", Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leoo",
                    Height = 1,
                    Width = 2,
                    Direction = AnimationDirection.Right,
                    ImagePath = @"/Assets/TileImages/7.png"
                });
                results.Add(new HubItem() {
                    Name = "Sample Item 7", Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 1,
                    Width = 2,
                    Direction = AnimationDirection.Right,
                    ImagePath = @"/Assets/TileImages/8.png"
                });
                results.Add(new HubItem() {
                    Name = "Sample Item 8", Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 1,
                    Width = 2,
                    Direction = AnimationDirection.Right,
                    ImagePath = @"/Assets/TileImages/9.png"
                });
                results.Add(new HubItem() {
                    Name = "Sample Item 9", Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 1,
                    Width = 2,
                    Direction = AnimationDirection.Right,
                    ImagePath = @"/Assets/TileImages/10.png"
                });
                results.Add(new HubItem()
                {
                    Name = "Sample Item 10",
                    Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 1,
                    Width = 2,
                    Direction = AnimationDirection.Right,
                    ImagePath = @"/Assets/TileImages/11.png"
                });
                results.Add(new HubItem()
                {
                    Name = "Sample Item 11",
                    Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 1,
                    Width = 2,
                    Direction = AnimationDirection.Right,
                    ImagePath = @"/Assets/TileImages/12.png"
                });
                results.Add(new HubItem()
                {
                    Name = "Sample Item 12",
                    Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 1,
                    Width = 2,
                    Direction = AnimationDirection.Right,
                    ImagePath = @"/Assets/TileImages/13.png"
                });
                results.Add(new HubItem()
                {
                    Name = "Sample Item 13",
                    Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 1,
                    Width = 2,
                    Direction = AnimationDirection.Right,
                    ImagePath = @"/Assets/TileImages/14.png"
                });
                results.Add(new HubItem()
                {
                    Name = "Sample Item 14",
                    Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 1,
                    Width = 2,
                    Direction = AnimationDirection.Right,
                    ImagePath = @"/Assets/TileImages/15.png"
                });
                results.Add(new HubItem()
                {
                    Name = "Sample Item 15",
                    Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 1,
                    Width = 2,
                    Direction = AnimationDirection.Right,
                    ImagePath = @"/Assets/TileImages/16.png"
                });

                /*
                results.Add(new HubItem() {
                    Name = "Sample Item 0", Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 2,
                    Width = 6,
                    Direction = AnimationDirection.Top,
                    ImagePath = @"/Assets/TileImages/1.png"
                });
                results.Add(new HubItem() {
                    Name = "Sample Item 1", Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 1,
                    Width = 3,
                    Direction = AnimationDirection.Right,
                    ImagePath = @"/Assets/TileImages/2.png"
                });
                results.Add(new HubItem() {
                    Name = "Sample Item 2", Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 1,
                    Width = 3,
                    Direction = AnimationDirection.Top,
                    ImagePath = @"/Assets/TileImages/3.png"
                });
                results.Add(new HubItem() { 
                    Name = "Sample Item 3", Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 1,
                    Width = 3,
                    Direction = AnimationDirection.Top,
                    ImagePath = @"/Assets/TileImages/4.png"
                });
                results.Add(new HubItem() {
                    Name = "Sample Item 4", Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 2,
                    Width = 3,
                    Direction = AnimationDirection.Right,
                    ImagePath = @"/Assets/TileImages/5.png"
                });
                results.Add(new HubItem() {
                    Name = "Sample Item 5", Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 1,
                    Width = 2,
                    Direction = AnimationDirection.Top,
                    ImagePath = @"/Assets/TileImages/6.png"
                });
                results.Add(new HubItem() {
                    Name = "Sample Item 6", Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leoo",
                    Height = 1,
                    Width = 2,
                    Direction = AnimationDirection.Right,
                    ImagePath = @"/Assets/TileImages/7.png"
                });
                results.Add(new HubItem() {
                    Name = "Sample Item 7", Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 1,
                    Width = 2,
                    Direction = AnimationDirection.Right,
                    ImagePath = @"/Assets/TileImages/8.png"
                });
                results.Add(new HubItem() {
                    Name = "Sample Item 8", Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 1,
                    Width = 2,
                    Direction = AnimationDirection.Right,
                    ImagePath = @"/Assets/TileImages/9.png"
                });
                results.Add(new HubItem() {
                    Name = "Sample Item 9", Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 1,
                    Width = 2,
                    Direction = AnimationDirection.Right,
                    ImagePath = @"/Assets/TileImages/10.png"
                });
                results.Add(new HubItem()
                {
                    Name = "Sample Item 10",
                    Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 1,
                    Width = 2,
                    Direction = AnimationDirection.Right,
                    ImagePath = @"/Assets/TileImages/11.png"
                });
                results.Add(new HubItem()
                {
                    Name = "Sample Item 11",
                    Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 1,
                    Width = 2,
                    Direction = AnimationDirection.Right,
                    ImagePath = @"/Assets/TileImages/12.png"
                });
                results.Add(new HubItem()
                {
                    Name = "Sample Item 12",
                    Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 1,
                    Width = 2,
                    Direction = AnimationDirection.Right,
                    ImagePath = @"/Assets/TileImages/13.png"
                });
                results.Add(new HubItem()
                {
                    Name = "Sample Item 13",
                    Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 1,
                    Width = 2,
                    Direction = AnimationDirection.Right,
                    ImagePath = @"/Assets/TileImages/14.png"
                });
                results.Add(new HubItem()
                {
                    Name = "Sample Item 14",
                    Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 1,
                    Width = 2,
                    Direction = AnimationDirection.Right,
                    ImagePath = @"/Assets/TileImages/15.png"
                });
                results.Add(new HubItem()
                {
                    Name = "Sample Item 15",
                    Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis nisi nunc, in eleifend leo",
                    Height = 1,
                    Width = 2,
                    Direction = AnimationDirection.Right,
                    ImagePath = @"/Assets/TileImages/16.png"
                });
                 */


                Random rnd = new Random();

                for (int j = 0; j < results.Count; j++)
                {
                    int c = j % (results.Count / 5);
                    results[j].Category = string.Format("Category: {0}", c);
                }

                //results.Add(new HubItem() { Name = "Malt", Height = 1, Width = 1, ImagePath = @"/Assets/Images/malt.jpg" });
                //results.Add(new HubItem() { Name = "Water", Height = 2, Width = 2, ImagePath = @"/Assets/Images/water.jpg" });
                //results.Add(new HubItem() { Name = "Yeast", Height = 1, Width = 2, ImagePath = @"/Assets/Images/yeast.jpg" });
                //results.Add(new HubItem() { Name = "Sugar", Height = 1, Width = 1, ImagePath = @"/Assets/Images/sugars.jpg" });
                //results.Add(new HubItem() { Name = "Herbs", Height = 2, Width = 2, ImagePath = @"/Assets/Images/herbs.jpg" });
                //results.Add(new HubItem() { Name = "Beer", Height = 1, Width = 2, ImagePath = @"/Assets/Images/beer.jpg" });
                //results.Add(new HubItem() { Name = "Hops", Height = 1, Width = 1, ImagePath = @"/Assets/Images/hops.jpg" });
                //results.Add(new HubItem() { Name = "Malt", Height = 2, Width = 2, ImagePath = @"/Assets/Images/malt.jpg" });
                //results.Add(new HubItem() { Name = "Water", Height = 1, Width = 2, ImagePath = @"/Assets/Images/water.jpg" });
                //results.Add(new HubItem() { Name = "Sugar", Height = 1, Width = 2, ImagePath = @"/Assets/Images/sugars.jpg" });
                //results.Add(new HubItem() { Name = "Yeast", Height = 2, Width = 2, ImagePath = @"/Assets/Images/yeast.jpg" });
                //results.Add(new HubItem() { Name = "Herbs", Height = 2, Width = 2, ImagePath = @"/Assets/Images/herbs.jpg" });

                return results;
            }
        }
    }

    public class HubItem : HDK.UI.Controls.IVariableSizedGridViewResizableItem
    {
        public string Name { get; set; }
        public string Description { get; set; }

        public string ImagePath { get; set; }

        public int Width { get; set; }
        public int Height { get; set; }

        public AnimationDirection Direction { get; set; }

        public string Category { get; set; }


        public HubItem()
        {
            Direction = AnimationDirection.Right;
        }
    }











    public abstract class HubItemFilter : DataViewFiltererBase
    {
        public HubItemFilter(IEnumerable<HubItem> items)
            : base(items)
        {
        }
    }
    public abstract class FilteredHubItemFilter : HubItemFilter
    {
        // Methods
        public FilteredHubItemFilter(IEnumerable<HubItem> items)
            : base(items)
        {
            SelectedSubFilter = null;
        }

        public override void RefreshResults()
        {
            if (this.SelectedSubFilter != null)
            {
                this.SelectedSubFilter.RefreshResults();
                base.Results = this.SelectedSubFilter.Results;
            }
        }

        public abstract void RefreshSubFilters();

    }

    public class SingleHubItemPropertyFilter : HubItemFilter
    {
        // Fields
        private Func<HubItem, string> _PropertySelector;

        // Methods
        public SingleHubItemPropertyFilter(IEnumerable<HubItem> library, string name, Func<HubItem, string> PropertySelector)
            : base(library)
        {
            this.Name = name;
            this._PropertySelector = PropertySelector;
        }

        public override void RefreshResults()
        {
            var collection = base.Items.Cast<HubItem>().Where((pcvm) => _PropertySelector(pcvm).Equals(this.Name));
            base.Results = new List<HubItem>(collection);
        }

        // Properties
        public override string DisplayText
        {
            get
            {
                return this.Name;
            }
        }

        public string Name { get; set; }
    }


    public class AllHubItemsFilter : HubItemFilter
    {
        // Methods
        public AllHubItemsFilter(IEnumerable<HubItem> library)
            : base(library)
        {
        }

        public override void RefreshResults()
        {
            base.Results = new List<HubItem>(base.Items.Cast<HubItem>());
        }

        // Properties
        public override string DisplayText
        {
            get
            {
                return "All";
            }
        }
    }

    public class HubItemPropertyFilter : FilteredHubItemFilter
    {
        // Fields
        private Func<HubItem, string> _PropertySelector;
        private string _Title;

        // Methods
        public HubItemPropertyFilter(IEnumerable<HubItem> library, string Title, Func<HubItem, string> PropertySelector)
            : base(library)
        {
            this._Title = Title;
            this._PropertySelector = PropertySelector;
            
        }


        public override void RefreshSubFilters()
        {
            //var collection = base.Library.Items;

            //this._SubFilters = new List<ProjectFilter>(collection);
        }

        // Properties
        public override string DisplayText
        {
            get
            {
                return this._Title;
            }
        }
    }

    public class TitleFilter : HubItemPropertyFilter
    {
        // Methods
        public TitleFilter(IEnumerable<HubItem> library)
            : base(library, "Title", (pvm) => (pvm as HubItem).Name)
        {
        }
    }


    public class HubItemsCollectionFilter : FilteredHubItemFilter
    {

        // Methods
        public HubItemsCollectionFilter(IEnumerable<HubItem> library)
            : base(library)
        {
            SubFilters.Add(new AllHubItemsFilter(library));
            SubFilters.Add(new TitleFilter(library));
            //this._SubFilters.Add(new RecentProjectsFilter(library));
            //this._SubFilters.Add(new PortfolioProjectFilter(library));
            //this._SubFilters.Add(new StakeholdersFilter(library));
            //this._SubFilters.Add(new StatusFilter(library));
            //this._SubFilters.Add(new AuthorsFilter(library));
            //this._SubFilters.Add(new DecadeFilter(library));
            SubFilters.Sort((f1, f2) => string.Compare(f1.DisplayText, f2.DisplayText));
        }

        public override void RefreshResults()
        {
            if ((base.Items != null))
            {
                base.Results = new List<HubItem>(base.Items.Cast<HubItem>());
            }
        }

        public override void RefreshSubFilters()
        {
        }

        // Properties
        public override string DisplayText
        {
            get
            {
                return "Projects";
            }
        }
    }














}
